{% if site.disqus_shortname %}
<div id="disqus_thread"></div>
<script>
    var disqus_config = function () {
        this.page.url = "{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}";
        this.page.identifier = "{{ page.path }}";
    };
    (function() {
        var d = document, s = d.createElement('script');
        s.src = '//{{ site.disqus_shortname }}.disqus.com/embed.js';
        s.setAttribute('data-timestamp', +new Date());
        (d.head || d.body).appendChild(s);
    })();
</script>
{% endif %}
